#-- coding=UTF-8
from kwpIdDefine import *

class literal(object):
    #use for Option_Pedal and Option_SteerAngleSensor parameter
    UNDEFINED_INVALID   = 0
    SINGLE_PEDAL        = 1
    DUAL_PEDAL          = 2
    RESERVE             = 3
    
    
        
class actionInput:
    def __init__(self):
        self.global_lastLID = local_id_option.LAST_LID
        self.global_1stCID   = CommonIdOption.FIRST_CID
        self.global_lastCID = CommonIdOption.LAST_CID
        
        self.ClearDTC                               = False
        self.ReadDTC                                = False
        self.ReadDtcAndStatus                       = False
        self.TesterPresent                          = False
        self.EcuReset                               = False
        self.StartDiagnosticSession                 = False
        self.ReadECUidentification                  = False
        self.ReadLID                                = True
        self.ReadCID                                = True 
        
        #teach steer
        self.TEACH_STEER_START              = False
        self.TEACH_STEERL                   = False
        self.TEACH_STEERR                   = False
        self.TEACH_STEER_NEUTRAL            = False
        
        #teach ACC1
        self.TEACH_ACCELERATOR1_START       = False
        self.TEACH_ACCELERATOR1_MIN         = False     
        self.TEACH_ACCELERATOR1_MAX         = False   
        
        #teach ACC2
        self.TEACH_ACCELERATOR2_START       = False
        self.TEACH_ACCELERATOR2_MIN         = False     
        self.TEACH_ACCELERATOR2_MAX         = False  
        
        #teach LIFT
        self.TEACH_LIFT_POTENTIOMETER_START = False
        self.TEACH_LIFT_POTENTIOMETER_MIN   = False     
        self.TEACH_LIFT_POTENTIOMETER_MAX   = False 
        

        #恢复默认值,下列选项尽量不要同时开启
        self.StartRoutine                           = False
        #StartRoutine subSwitch 1 会恢复所有参数默认值-小心使用！！！
        self.PARAMSRESET_ALL = True 
        #StartRoutine subSwitch 2
        self.setDefault_LID_X = False
        self.global_Defaulting_LID_X = [
            #local_id_option.LID_PADDING1,
        ]
        #StartRoutine subSwitch 3
        self.setDefault_CID_X = False
        self.global_Defaulting_CID_X = [
             CommonIdOption.CID_TRUCKID,
        ]
        
        #写LID输入 #0----255 ID Range
        self.writeLID =False
        self.global_W_LID_X = [
            #Option_Pedal
            # [local_id_option.LID_OPTION_PEDAL,literal.UNDEFINED_INVALID],
            # [local_id_option.LID_OPTION_PEDAL,literal.SINGLE_PEDAL],
            
            # [local_id_option.LID_OPTION_PEDAL,literal.DUAL_PEDAL],      #==============
            # [local_id_option.LID_LIFT_MODE,3],  # pol-meter             #==============    
            
            # [local_id_option.LID_OPTION_PEDAL,literal.RESERVE],
            #Option_SteerAngleSensor
            # [local_id_option.LID_OPTION_STEERANGLESENSOR,literal.UNDEFINED_INVALID],
            # [local_id_option.LID_OPTION_STEERANGLESENSOR,literal.SINGLE_PEDAL],
            # [local_id_option.LID_OPTION_STEERANGLESENSOR,literal.DUAL_PEDAL],
            # [local_id_option.LID_OPTION_STEERANGLESENSOR,literal.RESERVE],
            # [local_id_option.LID_LINDE_PARTNUMBER,"12345678977",11],
            # [local_id_option.LID_LINDE_PARTNUMBER,"12345678",8],
            # [local_id_option.LID_BATTERYTYPE,0],    #LION BATTERY
            [local_id_option.LID_BATTERYTYPE,1],    #LEAD-ACID BATTERY
            # [local_id_option.LID_BDI_CUTVPC,189],    #cell V-empty 48V tianNeng battery
            
            # [local_id_option.LID_OPTION_STEERANGLESENSOR,2],
            # [local_id_option.LID_FAN1_TEMPERATURE_ON,3333],
            
            
        ]
        #写CID输入 256---0xFFF ID Range
        self.writeCID = False
        self.global_W_CID_X = [
            #[CommonIdOption.CID_ADC0_X_2,4234],   
            # [CommonIdOption.CID_SWAP_ENCODER,1],   
            # [CommonIdOption.CID_ENCODE_STEP,100],   
            # [CommonIdOption.CID_BDI_VBATT_CAL,2335],   
            [CommonIdOption.CID_VIN,"123456789ABC",13],   
            # [CommonIdOption.CID_SWAP_ENCODER,1],    #    
            
            [CommonIdOption.CID_KEY_SWITCH_CAL,99],   
        ]
        
        
        
        #放在最后
        self.EnterSecurityMode_and_PassiveMode      = self.writeLID or self.writeCID or self.ClearDTC or self.StartRoutine or self.EcuReset
        self.EnterSecurityMode_and_PassiveMode      = self.EnterSecurityMode_and_PassiveMode or self.TEACH_STEER_START or self.TEACH_STEERL or self.TEACH_STEERR or self.TEACH_STEER_NEUTRAL
        self.EnterSecurityMode_and_PassiveMode      = self.EnterSecurityMode_and_PassiveMode or self.TEACH_ACCELERATOR1_START or self.TEACH_ACCELERATOR1_MIN or self.TEACH_ACCELERATOR1_MAX
        self.EnterSecurityMode_and_PassiveMode      = self.EnterSecurityMode_and_PassiveMode or self.TEACH_ACCELERATOR2_START or self.TEACH_ACCELERATOR2_MIN or self.TEACH_ACCELERATOR2_MAX
        self.EnterSecurityMode_and_PassiveMode      = self.EnterSecurityMode_and_PassiveMode or self.TEACH_LIFT_POTENTIOMETER_START or self.TEACH_LIFT_POTENTIOMETER_MIN or self.TEACH_LIFT_POTENTIOMETER_MAX
        
        
        
        
        
        
        
        
        
        